/* I create useful macros in this file. Nicolas Van de Sijpe, 08-May-2012 */


***********************************************
* GLOBAL FOR DATA DIRECTORY
***********************************************
global datadirfung C:\Users\Nicolasvds\Documents\My papers\Is foreign aid fungible, education and health\Data\Estimated complete disbursements\regression do-files\WBER replication


***************************************************************************************
* LOCALS FOR RHS VARIABLES OF DIFFERENT MODELS WITHOUT GROWTH AND WITH AGE DEPENDENCY
***************************************************************************************
/* Linear models, aggregate and disaggregate for both sectors. */
local EDUCATIONAGGR educationtotalGDP6 generaltotalGDP6 supporttoNGOstotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands /// 
intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local EDUCATIONDISAGGR educationIPtotalGDP6 educationSPtotalGDP6 educationTCtotalGDP6 educationONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP 
local HEALTHAGGR healthtotalGDP6 generaltotalGDP6 supporttoNGOstotalGDP6 othersectorhealthGDP6 GDPpercapPPPctthousands /// 
intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP 
local HEALTHDISAGGR healthIPtotalGDP6 healthSPtotalGDP6 healthTCtotalGDP6 healthONMtotalGDP6 generaltotalGDP6 supporttoNGOstotalGDP6 /// 
othersectorhealthGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP 

/* Linear models, aggregate and disaggregate for both sectors for scaled CRS variables. */
local EDUCATIONAGGRCRSSC educationCRSscaledGDP generalCRSscaledGDP supporttoNGOsCRSscaledGDP othereducCRSscaledGDP GDPpercapPPPctthousands /// 
intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local EDUCATIONDISAGGRCRSSC educationIPCRSscaledGDP educationSPCRSscaledGDP educationTCCRSscaledGDP educationONMCRSscaledGDP generalCRSscaledGDP /// 
supporttoNGOsCRSscaledGDP othereducCRSscaledGDP GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP 
local HEALTHAGGRCRSSC healthCRSscaledGDP generalCRSscaledGDP supporttoNGOsCRSscaledGDP otherhealthCRSscaledGDP GDPpercapPPPctthousands /// 
intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local HEALTHDISAGGRCRSSC healthIPCRSscaledGDP healthSPCRSscaledGDP healthTCCRSscaledGDP healthONMCRSscaledGDP generalCRSscaledGDP /// 
supporttoNGOsCRSscaledGDP otherhealthCRSscaledGDP GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP 

/* Double-log models, aggregate and disaggregate: */
local EDUCATIONAGGRLN lneducationtotalGDP6 lngeneraltotalGDP6 lnsupporttoNGOstotalGDP6 lnothersectoreducGDP6 lnGDPpercapitaPPPconstant /// 
intDgrowthGDPpercap lnurbanisation lntradeGDP lndebtPVDikhGDP lndebtservicepublicLTGDP
local EDUCATIONDISAGGRLN lneducationIPtotalGDP6 lneducationSPtotalGDP6 lneducationTCtotalGDP6 lneducationONMtotalGDP6 lngeneraltotalGDP6 /// 
lnsupporttoNGOstotalGDP6 lnothersectoreducGDP6 lnGDPpercapitaPPPconstant intDgrowthGDPpercap lnurbanisation lntradeGDP lndebtPVDikhGDP lndebtservicepublicLTGDP 
local HEALTHAGGRLN lnhealthtotalGDP6 lngeneraltotalGDP6 lnsupporttoNGOstotalGDP6 lnothersectorhealthGDP6 lnGDPpercapitaPPPconstant /// 
intDgrowthGDPpercap lnurbanisation lntradeGDP lndebtPVDikhGDP lndebtservicepublicLTGDP 
local HEALTHDISAGGRLN lnhealthIPtotalGDP6 lnhealthSPtotalGDP6 lnhealthTCtotalGDP6 lnhealthONMtotalGDP6 lngeneraltotalGDP6 lnsupporttoNGOstotalGDP6 /// 
lnothersectorhealthGDP6 lnGDPpercapitaPPPconstant intDgrowthGDPpercap lnurbanisation lntradeGDP lndebtPVDikhGDP lndebtservicepublicLTGDP

/* Linear disaggregated models with a lagged dependent variable */
local LEDUCATIONDISAGGR LpublicexpeducationFADGDP educationIPtotalGDP6 educationSPtotalGDP6 educationTCtotalGDP6 educationONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local LHEALTHDISAGGR LpublicexphealthFADGDP healthIPtotalGDP6 healthSPtotalGDP6 healthTCtotalGDP6 healthONMtotalGDP6 generaltotalGDP6 supporttoNGOstotalGDP6 /// 
othersectorhealthGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP 

/* Linear disaggregated models with a lagged dependent variable and an additional lag for TC */
local LEDUCATIONDISAGGRlagTCadd LpublicexpeducationFADGDP educationIPtotalGDP6 educationSPtotalGDP6 educationTCtotalGDP6 LeducationTCtotalGDP6 educationONMtotalGDP6 /// 
generaltotalGDP6 supporttoNGOstotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local LHEALTHDISAGGRlagTCadd LpublicexphealthFADGDP healthIPtotalGDP6 healthSPtotalGDP6 healthTCtotalGDP6 LhealthTCtotalGDP6 healthONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectorhealthGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP 

/* Linear disaggregated models with a lagged dependent variable and a lag for TC substituted in for current TC */
local LEDUCATIONDISAGGRlagTCin LpublicexpeducationFADGDP educationIPtotalGDP6 educationSPtotalGDP6 LeducationTCtotalGDP6 educationONMtotalGDP6 /// 
generaltotalGDP6 supporttoNGOstotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local LHEALTHDISAGGRlagTCin LpublicexphealthFADGDP healthIPtotalGDP6 healthSPtotalGDP6 LhealthTCtotalGDP6 healthONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectorhealthGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP 


***********************************************
* SYSTEMS GMM RHS VARIABLES
***********************************************
/* The basic collection of RHS variables for the disaggregated model. */
local LAGEDUCATION LpublicexpeducationFADGDP
local LAGHEALTH LpublicexphealthFADGDP 
local EDUCATIONDISAGGRENDOG educationIPtotalGDP6 educationSPtotalGDP6 educationTCtotalGDP6 educationONMtotalGDP6 supporttoNGOstotalGDP6 tradeGDP 
local HEALTHDISAGGRENDOG healthIPtotalGDP6 healthSPtotalGDP6 healthTCtotalGDP6 healthONMtotalGDP6 supporttoNGOstotalGDP6 tradeGDP
local EDUCATIONPREDETERM generaltotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation debtPVDikhGDP debtservicepublicLTGDP 
local HEALTHPREDETERM generaltotalGDP6 othersectorhealthGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation debtPVDikhGDP debtservicepublicLTGDP
local EDUCATIONSTRICTEXOG 
local HEALTHSTRICTEXOG
local TIME year1991-year2003


*************************************************************
* LOCALS THAT GROUP VARIABLES TO EXPORT VIA ESTTAB FOR ORDER
*************************************************************
/* Joint aggregate model for education and health next to each other */
local EDUCHEALTHAGGR educationtotalGDP6 healthtotalGDP6 generaltotalGDP6 supporttoNGOstotalGDP6 othersectoreducGDP6 othersectorhealthGDP6 ///
GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP

/* Joint disaggregated model for education and health next to each other */
local EDUCHEALTHDISAGGR educationIPtotalGDP6 educationSPtotalGDP6 educationTCtotalGDP6 educationONMtotalGDP6 healthIPtotalGDP6 /// 
healthSPtotalGDP6 healthTCtotalGDP6 healthONMtotalGDP6 generaltotalGDP6 supporttoNGOstotalGDP6 othersectoreducGDP6 othersectorhealthGDP6 ///
GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP

/* Joint disaggregated model for education and health next to each other, scaled CRS data. */
local EDUCHEALTHDISAGGRCRSSC educationIPCRSscaledGDP educationSPCRSscaledGDP educationTCCRSscaledGDP educationONMCRSscaledGDP healthIPCRSscaledGDP /// 
healthSPCRSscaledGDP healthTCCRSscaledGDP healthONMCRSscaledGDP generalCRSscaledGDP supporttoNGOsCRSscaledGDP othereducCRSscaledGDP otherhealthCRSscaledGDP ///
GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP

/* Joint disaggregated model for education and health next to each other LN. */
local EDUCHEALTHDISAGGRLN lneducationIPtotalGDP6 lneducationSPtotalGDP6 lneducationTCtotalGDP6 lneducationONMtotalGDP6 lnhealthIPtotalGDP6 /// 
lnhealthSPtotalGDP6 lnhealthTCtotalGDP6 lnhealthONMtotalGDP6 lngeneraltotalGDP6 lnsupporttoNGOstotalGDP6 lnothersectoreducGDP6 lnothersectorhealthGDP6 ///
lnGDPpercapitaPPPconstant intDgrowthGDPpercap lnurbanisation lntradeGDP lndebtPVDikhGDP lndebtservicepublicLTGDP

/* Joint disaggregated model for education and health next to each other with lagged dependent variables. */
local LEDUCHEALTHDISAGGR LpublicexpeducationFADGDP educationIPtotalGDP6 educationSPtotalGDP6 educationTCtotalGDP6 educationONMtotalGDP6 LpublicexphealthFADGDP /// 
healthIPtotalGDP6 healthSPtotalGDP6 healthTCtotalGDP6 healthONMtotalGDP6 generaltotalGDP6 supporttoNGOstotalGDP6 othersectoreducGDP6 othersectorhealthGDP6 ///
GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP

/* education aggregate and disaggregate next to each other */
local EDUCAGGRDISAGGR educationtotalGDP6 educationIPtotalGDP6 educationSPtotalGDP6 educationTCtotalGDP6 educationONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
/* health aggregate and disaggregate next to each other */
local HEALTHAGGRDISAGGR healthtotalGDP6 healthIPtotalGDP6 healthSPtotalGDP6 healthTCtotalGDP6 healthONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectorhealthGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP

/* education aggregate and disaggregate next to each other scaled CRS variables */
local EDUCAGGRDISAGGRCRSSC educationCRSscaledGDP educationIPCRSscaledGDP educationSPCRSscaledGDP educationTCCRSscaledGDP educationONMCRSscaledGDP generalCRSscaledGDP /// 
supporttoNGOsCRSscaledGDP othereducCRSscaledGDP GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
/* health aggregate and disaggregate next to each other scaled CRS variables  */
local HEALTHAGGRDISAGGRCRSSC healthCRSscaledGDP healthIPCRSscaledGDP healthSPCRSscaledGDP healthTCCRSscaledGDP healthONMCRSscaledGDP generalCRSscaledGDP /// 
supporttoNGOsCRSscaledGDP otherhealthCRSscaledGDP GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP

/* education aggregate and disaggregate next to each other LN */
local EDUCAGGRDISAGGRLN lneducationtotalGDP6 lneducationIPtotalGDP6 lneducationSPtotalGDP6 lneducationTCtotalGDP6 lneducationONMtotalGDP6 lngeneraltotalGDP6 /// 
lnsupporttoNGOstotalGDP6 lnothersectoreducGDP6 lnGDPpercapitaPPPconstant intDgrowthGDPpercap lnurbanisation lntradeGDP lndebtPVDikhGDP lndebtservicepublicLTGDP

/* health aggregate and disaggregate next to each other LN */
local HEALTHAGGRDISAGGRLN lnhealthtotalGDP6 lnhealthIPtotalGDP6 lnhealthSPtotalGDP6 lnhealthTCtotalGDP6 lnhealthONMtotalGDP6 lngeneraltotalGDP6 /// 
lnsupporttoNGOstotalGDP6 lnothersectorhealthGDP6 lnGDPpercapitaPPPconstant intDgrowthGDPpercap lnurbanisation lntradeGDP lndebtPVDikhGDP lndebtservicepublicLTGDP

/* Disaggregated and aggregate models for both sectors with lagged dependent variables. */
local LEDUCATIONDISAGGR LpublicexpeducationFADGDP educationIPtotalGDP6 educationSPtotalGDP6 educationTCtotalGDP6 educationONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local LHEALTHDISAGGR LpublicexphealthFADGDP healthIPtotalGDP6 healthSPtotalGDP6 healthTCtotalGDP6 healthONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectorhealthGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local LEDUCATIONAGGR LpublicexpeducationFADGDP educationtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local LHEALTHAGGR LpublicexphealthFADGDP healthtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectorhealthGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP

/* Disaggregated models for both sectors with lagged dependent variables and extra lag of the TC variable. */
local LEDUCATIONDISAGGREXTRAL LpublicexpeducationFADGDP educationIPtotalGDP6 educationSPtotalGDP6 educationTCtotalGDP6 LeducationTCtotalGDP6 educationONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectoreducGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP
local LHEALTHDISAGGREXTRAL LpublicexphealthFADGDP healthIPtotalGDP6 healthSPtotalGDP6 healthTCtotalGDP6 LhealthTCtotalGDP6 healthONMtotalGDP6 generaltotalGDP6 /// 
supporttoNGOstotalGDP6 othersectorhealthGDP6 GDPpercapPPPctthousands intDgrowthGDPpercap urbanisation tradeGDP debtPVDikhGDP debtservicepublicLTGDP


*************************************************************
* LOCALS THAT SUMMARISE ESTIMATION CHARACTERISTICS FOR STATA
*************************************************************
/* For FE and two sectors next to each other */
local FEStataoutput b(a2) se(a2) star(* 0.10 ** 0.05 *** 0.01) label nonotes /// 
alignment(\textwidth}{@{\extracolsep{\fill}}lcc) scalar("R2 $ R^2$" F_test F_test_p "F_FE F_test_FE" "SarganHansen Hausman statistic" "Hausmanp Hausman p-value" /// 
serialcorr_p "fullfungtestSP $\beta_{SP} \leqslant 0$" "nofungtestSP $\beta_{SP} \geqslant 1$" "fullfungtestTC $\beta_{TC} \leqslant -1$" "nofungtestTC $\beta_{TC} \geqslant 0$" /// 
"Countries Countries") /// 
sfmt(%05.3f a3 %05.3f a3 a3 %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %8.0g) obslast

/* For OLS-FE-FD and two sectors next to each other */
local OLSFEFDStataoutput b(a2) se(a2) star(* 0.10 ** 0.05 *** 0.01) label nonotes /// 
alignment(\textwidth}{@{\extracolsep{\fill}}lcccccc) scalar("R2 $ R^2$" F_test F_test_p "F_FE F_test_FE" "SarganHansen Hausman statistic" "Hausmanp Hausman p-value" /// 
serialcorr_p "fullfungtestSP $\beta_{SP} \leqslant 0$" "nofungtestSP $\beta_{SP} \geqslant 1$" "fullfungtestTC $\beta_{TC} \leqslant -1$" "nofungtestTC $\beta_{TC} \geqslant 0$" /// 
"Countries Countries") /// 
sfmt(%05.3f a3 %05.3f a3 a3 %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %8.0g) obslast

/* For FE-FD and two sectors next to each other */
local FEFDStataoutput b(a2) se(a2) star(* 0.10 ** 0.05 *** 0.01) label nonotes /// 
alignment(\textwidth}{@{\extracolsep{\fill}}lcccc) scalar("R2 $ R^2$" F_test F_test_p "F_FE F_test_FE" "SarganHansen Hausman statistic" "Hausmanp Hausman p-value" /// 
serialcorr_p "fullfungtestSP $\beta_{SP} \leqslant 0$" "nofungtestSP $\beta_{SP} \geqslant 1$" "fullfungtestTC $\beta_{TC} \leqslant -1$" "nofungtestTC $\beta_{TC} \geqslant 0$" /// 
"Countries Countries") /// 
sfmt(%05.3f a3 %05.3f a3 a3 %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %8.0g) obslast

/* For system GMM, single sector, disaggregated model. */
local GMMdynamicStataoutputDISAGGR b(a2) se(a2) star(* 0.10 ** 0.05 *** 0.01) label nonotes /// 
alignment(\textwidth}{@{\extracolsep{\fill}}lcccccc) scalar(F_test F_test_p p_restrictIPONM p_restrictnonTC p_restrictother "instruments #instruments" "m1_p m1" "m2_p m2" /// 
"hansen_p Hansen" Rood_level Rood_lagdepdiff Rood_lagdeplevel Rood_endog Rood_predeterm "fullfungtestSP $\beta_{SP} \leqslant 0$" /// 
"nofungtestSP $\beta_{SP} \geqslant 1$" "fullfungtestTC $\beta_{TC} \leqslant -1$" "nofungtestTC $\beta_{TC} \geqslant 0$" "LRSP $\beta_{SP}^{LR}$" LRSP_se /// 
"fullfungtestLRSP $\beta_{SP}^{LR} \leqslant 0$" "nofungtestLRSP $\beta_{SP}^{LR} \geqslant 1$" "LRTC $\beta_{TC}^{LR}$" LRTC_se /// 
"fullfungtestLRTC $\beta_{TC}^{LR} \leqslant -1$" "nofungtestLRTC $\beta_{TC}^{LR} \geqslant 0$" "Countries Countries") /// 
sfmt(a3 %05.3f %05.3f %05.3f %05.3f %8.0g %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f /// 
%05.3f %05.3f %05.3f %05.3f %05.3f a2 a2 %05.3f %05.3f a2 a2 %05.3f %05.3f %8.0g) obslast

/* For system GMM disaggregated with TC lag added, single sector */
local GMMdynamicStataoutputTClag b(a2) se(a2) star(* 0.10 ** 0.05 *** 0.01) label nonotes /// 
alignment(\textwidth}{@{\extracolsep{\fill}}lcccccc) scalar(F_test F_test_p p_restrictIPONM p_restrictnonTC p_restrictother "instruments #instruments" "m1_p m1" "m2_p m2" /// 
"hansen_p Hansen" Rood_level Rood_lagdepdiff Rood_lagdeplevel Rood_endog ///
Rood_predeterm "fullfungtestSP $\beta_{SP} \leqslant 0$" "nofungtestSP $\beta_{SP} \geqslant 1$" "fullfungtestTC $\beta_{TC} \leqslant -1$" /// 
"nofungtestTC $\beta_{TC} \geqslant 0$" "fullfungtestlagTC lag $\beta_{TC} \leqslant -1$" "nofungtestlagTC lag $\beta_{TC} \geqslant 0$" "LRSP $\beta_{SP}^{LR}$" LRSP_se /// 
"fullfungtestLRSP $\beta_{SP}^{LR} \leqslant 0$" "nofungtestLRSP $\beta_{SP}^{LR} \geqslant 1$" "LRTC $\beta_{TC}^{LR}$" LRTC_se /// 
"fullfungtestLRTC $\beta_{TC}^{LR} \leqslant -1$" "nofungtestLRTC $\beta_{TC}^{LR} \geqslant 0$" "Countries Countries") ///
sfmt(a3 %05.3f %05.3f %05.3f %05.3f %8.0g %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f /// 
%05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f a2 a2 %05.3f %05.3f a2 a2 %05.3f %05.3f %8.0g) obslast

/* For aggregate next to disaggregate model OLS-FE */
local AGGRDISAGGRStataoutput b(a2) se(a2) star(* 0.10 ** 0.05 *** 0.01) label nonotes /// 
/*alignment(\textwidth}{@{\extracolsep{\fill}}lcccc)*/ scalar("R2 $ R^2$" F_test F_test_p "F_FE F_test_FE" "SarganHansen Hausman statistic" "Hausmanp Hausman p-value" /// 
"fullfungtest $\beta \leqslant 0$" "nofungtest $\beta \geqslant 1$" "fullfungtestSP $\beta_{SP} \leqslant 0$" "nofungtestSP $\beta_{SP} \geqslant 1$" /// 
"fullfungtestTC $\beta_{TC} \leqslant -1$" "nofungtestTC $\beta_{TC} \geqslant 0$" "Countries Countries") /// 
sfmt(%05.3f a3 %05.3f a3 a3 %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %8.0g) obslast

/* For aggregate next to disaggregate model LN */
local AGGRDISAGGRLNStataoutput b(a2) se(a2) star(* 0.10 ** 0.05 *** 0.01) label nonotes /// 
/*alignment(\textwidth}{@{\extracolsep{\fill}}lcccccc)*/ scalar("R2 $ R^2$" F_test F_test_p "F_FE F_test_FE" "SarganHansen Hausman statistic" "Hausmanp Hausman p-value" /// 
"margeffect $\beta$" "fullfungtest $\beta \leqslant 0$" "nofungtest $\beta \geqslant 1$" "margeffectSP $\beta_{SP}$" "fullfungtestSP $\beta_{SP} \leqslant 0$" /// 
"nofungtestSP $\beta_{SP} \geqslant 1$" "margeffectTC $\beta_{TC}$" "fullfungtestTC $\beta_{TC} \leqslant -1$" "nofungtestTC $\beta_{TC} \geqslant 0$" "Countries Countries") /// 
sfmt(%05.3f a3 %05.3f a3 a3 %05.3f a3 %05.3f %05.3f a3 %05.3f %05.3f a3 %05.3f %05.3f %8.0g) obslast

*************************************************************
* LOCALS THAT SUMMARISE ESTIMATION CHARACTERISTICS FOR LATEX
*************************************************************
/* For aggregate OLS-FE model */
local OLSFELatexfour b(a2) se(a2) star(* 0.10 ** 0.05 *** 0.01) booktab label nonotes /// 
alignment(\textwidth}{@{\extracolsep{\fill}}lcccc) scalar("R2 $ R^2$" F_test F_test_p "F_FE F_test_FE" "SarganHansen Hausman statistic" "Hausmanp Hausman p-value" /// 
"fullfungtest $\beta \leqslant 0$" "nofungtest $\beta \geqslant 1$" "fullfungtestSP $\beta_{SP} \leqslant 0$" "nofungtestSP $\beta_{SP} \geqslant 1$" /// 
"fullfungtestTC $\beta_{TC} \leqslant -1$" "nofungtestTC $\beta_{TC} \geqslant 0$" "Countries Countries") /// 
sfmt(%05.3f a3 %05.3f a3 a3 %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %05.3f %8.0g) obslast

/* Disaggregate FE LN model for the two sectors next to each other */
local FEDISAGGRLNtwo b(a2) se(a2) star(* 0.10 ** 0.05 *** 0.01) booktab label nonotes /// 
alignment(\textwidth}{@{\extracolsep{\fill}}lcc) scalar("R2 $ R^2$" F_test F_test_p "F_FE F_test_FE" "SarganHansen Hausman statistic" "Hausmanp Hausman p-value" /// 
"margeffect $\beta$" "fullfungtest $\beta \leqslant 0$" "nofungtest $\beta \geqslant 1$" "margeffectSP $\beta_{SP}$" "fullfungtestSP $\beta_{SP} \leqslant 0$" /// 
"nofungtestSP $\beta_{SP} \geqslant 1$" "margeffectTC $\beta_{TC}$" "fullfungtestTC $\beta_{TC} \leqslant -1$" "nofungtestTC $\beta_{TC} \geqslant 0$" "Countries Countries") ///
sfmt(%05.3f a3 %05.3f a3 a3 %05.3f a3 %05.3f %05.3f a3 %05.3f %05.3f a3 %05.3f %05.3f %8.0g) obslast
